import { UserApi } from './user.api'
import { App } from '../../app'
import { ServiceBase, presetErr, commonErr } from 'koacat'

export class User extends ServiceBase<UserApi> {
  constructor(app: App) {
    super('user')

    const api = new UserApi(app)
    api.attachApisToRouter(app.router)
    this.api = api
    
  }

  public readonly err = presetErr(this.name, {
    ...commonErr,
    'USER_NOT_FOUND': { message: '该用户不存在或密码有误', status: 404 }
  })


}